package edu.wpi.first.wpilibj.robot;

import edu.wpi.first.wpilibj.*;

public class GyroMotor extends Motor{
    
    Gyro g;
    double angle = 0;
    Joystick js;
    PrintMotor pm;
    
    public GyroMotor(Gyro g, Joystick js, PrintMotor pm){
        this.g = g;
        
        this.pm = pm;
        
        angle = g.getAngle();
        
        this.js = js;
        
        g.setSensitivity(.0074);
    }
    
    public void run(){
        while(true){
            angle = g.getAngle();
            
            
            if (js.getRawButton(3)){
                g.reset();
               pm.setText("Gyroscope Reset!          ", 0);
            }
            if (js.getRawButton(2)){
                pm.setText("gyro at: "+(angle+6.5), 0);
            }
        }
    }
}
